#!/usr/bin/env python
#Boa:App:BoaApp

import sys
import wx
import logging
import MainFrame

logger = logging.getLogger('provinci')

modules ={u'IncomingRequestFrame': [0, '', u'IncomingRequestFrame.py'],
 u'MainFrame': [1, 'Main frame of Application', u'MainFrame.py'],
 u'RequestFrame': [0, '', u'RequestFrame.py']}

class BoaApp(wx.App):
    def OnInit(self):
        self.setupLogging()
        self.main = MainFrame.create(None)
        self.main.Show()
        self.SetTopWindow(self.main)
        return True
    
    def setupLogging(self):# Set up logging
        formatter = logging.Formatter('=%(filename)-30s%(levelname)-10s%(message)s')
        consoleHandler = logging.StreamHandler()
        consoleHandler.setFormatter(formatter)
        logger.addHandler(consoleHandler)
        logger.setLevel(logging.DEBUG) 
        logger.debug('Logging started...')            

def main():
    application = BoaApp(0)
    application.MainLoop()

if __name__ == '__main__':
    if len(sys.argv) > 0:
        logger.debug('======' + sys.argv[0])
        username = sys.argv[0]
    main()
